package com.example;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@Builder
public class Category {

    /**
     * 数据库存的三个字段id、pid、name
     */
    private Long id;
    private Long pid;
    private String name;

    /**
     * 子节点
     */
    private List<Category> children;
    /**
     * 当前节点的层数(start from 0)
     */
    private int index;
}
